package com.bwie.controller;

import com.bwie.bo.SpuBo;
import com.bwie.service.SpuService;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: day0423-pxx
 * @ClassName GoodsController
 * @description:
 * @author: 段阳
 * @create: 2024-05-03 22:23
 **/
@RestController
@RequestMapping("item/goods")
public class GoodsController {

    @Autowired
    private SpuService spuService;

    @PostMapping
    public R addSpuInfo(@RequestBody SpuBo spuBo){
        return spuService.addSpuInfo(spuBo);
    }

    @PutMapping
    public R upSpuInfo(@RequestBody SpuBo spuBo){
        return spuService.upSpuInfo(spuBo);
    }

    @PostMapping("/upsaleable")
    public R upsaleable(@RequestParam Long id){
        return spuService.upsaleable(id);
    }

    @PostMapping("/delSpu")
    public R delSpu(@RequestParam Long id){
        return spuService.delSpu(id);
    }

}